#include<stdio.h>
#include <malloc.h>

int main()
{

	int** p = (int**)malloc(sizeof(int*) * 3);
	int i = 0;
	for (i = 0; i < 3; i++)
	{
		p[i] = (int*)malloc(sizeof(int) * 5);
	}
	int j = 0;
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 5; j++)
		{
			p[i][j] = 5 * i + j;
		}
	}
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 5; j++)
		{
			printf("%d ", p[i][j]);
		}
		printf("\n");
	}
	for (i = 0; i < 3; i++)
	{
		free(p[i]);
	}
	free(p);
	p = NULL;
	return 0;
}